Rotate Effect ___________________ Version 1.0, Effector Set I (v1.0) ___________________ Media Lab Xtras ___________________ copyright 1997, As Is Software, Inc. Effect Symbol: #rotate _Properties______________Type______Value___ #animMode symbol #static, #range, #infinite, #pendulum, #relativeToPoint #numFrames integer 1+ #framesPerRevolution integer 0 not allowed, negative means rotate counterclockwise, #infinite only #interpolation integer 0, 1, 2 #degrees integer positive values are clockwise #radians integer positive values are clockwise #startDegrees integer #startRadians integer #endDegrees integer #endRadians integer #deltaDegrees integer positive values are clockwise #deltaRadians integer positive values are clockwise #flip integer true or false #relativeTo point stage coordinates, valid in RelToPoint mode only #relativeToX integer #relativeToY integer #offsetAngle integer valid in RelToPoint mode only #offsetAngleRad integer #easeIn integer frames #easeOut integer frames Parameters by Mode All Modes: interpolation flip Static: degrees radians endDegrees endRadians deltaDegrees deltaRadians Range: numFrames degrees radians endDegrees endRadians deltaDegrees deltaRadians startDegrees startRadians easeIn easeOut In #range mode the sprite will rotate to the endPosition from itís current (or start) position. If the endPosition is a number greater than its starting position then the sprite will rotate clockwise. If it is less than the starting position then it will rotate counter-clockwise. No abbreviating occurs, so if the sprite is at 0 degrees and it is given an endPosition of 720 degrees then it will rotate three times clockwise. Itís new starting position will be 720 degrees for the next call to range. Pendulum: numFrames degrees radians endDegrees endRadians deltaDegrees deltaRadians startDegrees startRadians easeIn easeOut Infinite: framesPerRevolution startDegrees startRadians easeIn In #infinite mode the sprite will simply rotate forever. A positive value for ëframesPerRevolutioní will cause it to rotate clockwise, a negative value will cause it to rotate ëcounter-clockwiseí. RelativeToPoint: relativeTo relativeToX relativeToY offsetAngle offsetAngleRad This is a custom mode for the rotate effect only. In this mode, the sprite will always ëfaceí the point at relativeToPoint, no matter where the sprite is on-screen. If desired, an offsetAngle argument can be provided. Custom Functions RelToPoint RelToPoint(sprite x, #rotate, xLocation, yLocation) RelToPoint(sprite x, #rotate, xLocation, yLocation, offsetAngle) RelToPoint(sprite x, #rotate, xLocation, yLocation, offsetAngle, flipFlag) RelToPoint(sprite x, #rotate, xLocation, yLocation, offsetAngle, flipFlag, interpolation) This is the mode accessor function for the #relativeToPoint mode. InterpolateNow InterpolateNow( sprite x, #rotate) This function causes the sprite to immediately redraw interpolated, but does not change the flag for the sprites overall interpolation setting. SetInterpolation SetInterpolation(sprite x, #rotate, interpolation) UseRadians UseRadians(sprite x, #rotate, true / false) Calling this function will make the sprite treat all subsequent function calls as if their degree arguments are in radians rather than degrees. Call this function with a ëfalseí argument to reset the sprite to regular degree usage. Flip Flip(sprite x, #rotate) Flip(sprite x, #rotate, flipFlag) If this function is called without the flipFlag argument, then the sprite will have itís flip state toggled. When the flipFlag argument is used, then the sprite will have its flip state set. GetAngle GetAngle(sprite x, #rotate) This argument will return the current angle of the sprite. GetVector GetVector(sprite x, #rotate, distance) GetVector(sprite x, #rotate, distance, degrees) This function converts a distance and an angle into the sub vectors X and Y. This function returns a point with the X and Y vectors in the x and y positions. If no angle is provided, the current angle of the sprite is used. GetRotatedRect GetRotatedRect(sprite x, #rotate) GetRotatedRect(sprite x, #rotate, degrees) GetRotatedRect(sprite x, #rotate, degrees, rect) This function takes a rect and an angle and calculates the new containing rect. If no angle is provided it uses the sprites current angle, and if no rect is provided it uses the rect of the castmember at the spriteís location. IsPointInRotatedRect IsPointInRotatedRect(sprite x, #rotate, point) IsPointInRotatedRect(sprite x, #rotate, point, degrees) IsPointInRotatedRect(sprite x, #rotate, point, degrees, rect) This function returns true or false if a point is in the rotated rectangle of the sprite. The current rectangle and angle of the sprite are used as defaults, but if desired the user can pass in custom arguments. Technical Support E-mail: xtra-help@medialab.com www.medialab.com